package com.yanqu.road.server.logic.recharge;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.config.goods.MallInfo;
import com.yanqu.road.entity.enums.eLogMoneyType;
import com.yanqu.road.entity.recharge.RechargeOrder;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.fund.ActivityFundModule;
import com.yanqu.road.server.gameplayer.module.activity.patronsfund.PatronsFundModule;
import com.yanqu.road.server.gameplayer.module.player.CurrencyModule;

public class NewPatronsFundMallRecharge extends BaseRecharge {

    public NewPatronsFundMallRecharge(GamePlayer player, MallInfo mallInfo, ActivityInfo activityInfo) {
        super(player, mallInfo, activityInfo);
    }

    @Override
    protected boolean isRepeatedBuy(String orderNo) {
        return false;
    }

    @Override
    protected void repeatedBuyLogic() {

    }

    @Override
    protected String addMall(String orderNo, RechargeOrder rechargeOrder) {
        player.getModule(ActivityFundModule.class).buy(this.mallInfo);
        player.getModule(CurrencyModule.class).addCurrency(mallInfo.getReward(), eLogMoneyType.PatronsFund, eLogMoneyType.PatronsFundBuyMall);
        logger.info("订单: {}, 购买 福利商品: {}", orderNo, mallInfo.getMallId());
        return mallInfo.getReward();
    }
}
